package com.mazaiting.gateway;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.context.annotation.ComponentScan;

/**
 * 网络服务启动类
 * 网关鉴权:
 *  <a href="https://blog.csdn.net/aoshilang2249/article/details/122846582">...</a>
 *  <a href="https://www.cnblogs.com/haoxianrui/p/13719356.html">...</a>
 * @author mazaiting
 * @create_time 2022/4/2 12:59
 */
@RefreshScope
@EnableDiscoveryClient
@SpringBootApplication
@ComponentScan(basePackages = {"com.mazaiting"})
public class ApolloGatewayApplication {

    public static void main(String[] args) {
        // 设置 gateway 类型, 解决 sentinel 控制台不显示 api 管理问题
        System.setProperty("csp.sentinel.app.type", "1");
        try {
            SpringApplication.run(ApolloGatewayApplication.class, args);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

}
